package com.deng.eventflow.core;

import java.util.Queue;

public class Adder extends SynchronousProcessor {

    public Adder()
    {
        super(2, 1);
    }

    @Override
    public Processor duplicate(boolean with_state) {
        return new Adder();
    }

    @Override
    protected boolean compute(Object[] inputs, Queue<Object[]> outputs) {
        outputs.add(new Object[]{((Integer) inputs[0]) + ((Integer) inputs[1])});
        return true;
    }

    @Override
    public Adder readState(Object o)
    {
        return new Adder();
    }

}
